package com.teach.flavour.model.entity;

import com.fasterxml.jackson.annotation.JsonProperty;

import java.io.Serializable;
import java.util.Arrays;

/**
 * @Author: Hzz
 * @Date: Created in 21:36 2020/4/29
 */
public class AssociatorFlavourVector implements Serializable {
    private String associatorId;
    @JsonProperty("salt_rank")
    private int saltRank;
    @JsonProperty("sour_rank")
    private int sourRank;
    @JsonProperty("spicy_rank")
    private int spicyRank;

    private int [] vector;

    public int[] getVector() {
        if (vector!=null){
            return vector;
        }
        setVector();
        return vector;
    }

    private void setVector() {
        vector=new int [3];
        vector[0]=this.getSaltRank();
        vector[1]=this.getSourRank();
        vector[2]=this.getSpicyRank();
    }

    public String getAssociatorId() {
        return associatorId;
    }

    public void setAssociatorId(String associatorId) {
        this.associatorId = associatorId;
    }

    public int getSaltRank() {
        return saltRank;
    }

    public void setSaltRank(int saltRank) {
        this.saltRank = saltRank;
    }

    public int getSourRank() {
        return sourRank;
    }

    public void setSourRank(int sourRank) {
        this.sourRank = sourRank;
    }

    public int getSpicyRank() {
        return spicyRank;
    }

    public void setSpicyRank(int spicyRank) {
        this.spicyRank = spicyRank;
    }

    @Override
    public String toString() {
        return Arrays.toString(vector);
    }
}
